package com.monster.mechanic.utils.logging;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class Log4jconfigurator {
	private static Logger logger;
    private static String log4jFile = "./src/main/logging/resources/log4j.properties";

    public static void configureLog4j()
    {
        try
        {
            PropertyConfigurator.configure( log4jFile );
        }
        catch ( Exception e )
        {
            BasicConfigurator.configure();
            Logger.getRootLogger().error(
                    "Failed to load logger" + e.getMessage() );
        }
        logger = Logger.getLogger( "com.monster" );
        logger.info( "##########	MONSTER MECHANIC	##########" );
        logger.info( "Log4j was loaded succesfully" );
    }
}
